<template>
  <el-form
    :model="formData"
    label-width="90px"
    label-suffix=":"
    :show-message="false"
    ref="formRef"
  >
    <el-form-item label="审批处理" prop="pass">
      <el-radio-group v-model="formData.status">
        <el-radio label="通过">通过</el-radio>
        <el-radio label="不通过">不通过</el-radio>
      </el-radio-group>
    </el-form-item>
    <el-form-item label="备注" prop="remark">
      <el-input
        v-model="formData.noSuccessDesc"
        type="textarea"
        :rows="4"
        placeholder="请输入"
      />
    </el-form-item>
    <el-row>
      <el-col :span="24" align="center">
        <el-button type="primary" @click="onSubmit">提交</el-button>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import { getDict } from '@/utils/index'
import { sp } from '@/api/pre-sale/newCarStock/newCarSaleManagement'
const dict = getDict(['入库状态'])

export default {
  components: {},
  props: {
    value: {
      default: '',
    },
  },
  data() {
    return {
      formData: {
        id: '',
        status: '通过',
        noSuccessDesc: '',
      },
    }
  },
  methods: {
    searchHandle() {},
    async onSubmit() {
      this.formData.id = this.value
      const { success } = await sp(this.formData)
      if (success) {
        this.$message({
          message: '操作成功',
          type: 'success',
        })
        this.$emit('close')
      } else {
        this.$message({
          message: '操作失败',
          type: 'success',
        })
      }
    },
  },
  created() {},
}
</script>

<style lang="scss" scoped>
</style>
